// PROGRAMA : IDCPBABN(PROGRAMA BATCH JCL = IDCPBABN)
// BIBLIOTECA : SISP
// OBJETIVO : GERAR ARQUIVO PARA AMERICAN BANK NOTE COMPANY - ABN
// : CRIMINAL
// : USER = FTPCRIMINAL
// : PASSWORD = FTPCR98
// : IP = 172.16.201.4
// PDS : PDS.SEJUSP
// ARQUIVO(PDS): IDC.CRIMINAL.ENV.ABN
package br.com.vti.sisp_sicrim.antigo.controller.programa;

import java.io.FileWriter;
import java.io.IOException;

import br.com.caelum.vraptor.Post;
import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.Resource;
import br.com.caelum.vraptor.Result;
import br.com.vti.sisp_sicrim.antigo.model.SicCadastro;
import br.com.vti.sisp_sicrim.antigo.util.ExceptionProgram;
import br.com.vti.sisp_sicrim.antigo.util.Sessao;
import br.com.vti.sisp_sicrim.antigo.util.UtilBean;

/**
 * Classe : Idcpbabn OBJETIVO : GERAR ARQUIVO PARA AMERICAN BANK NOTE COMPANY - ABN *
 * 
 * @author Incode - Data: mai/2014
 * 
 */
@Resource
@Path("/antigo/idcpbabn")
public class Idcpbabn {
	// Views utilizadas
	SicCadastro sicCadastroView = new SicCadastro();
	// Telas/relatorios utilizados
	// Includes utilizados
	// Areas globais / session
	// Funcoes/subrotinas
	FuncoesGerais funcoes = new FuncoesGerais();
	FileWriter arquivo1;

	Result result;
	Sessao sessao;
	Boolean primeiraVez = false;
	Idcpbabn idcpbabnAnterior;
	String faseproc = "0";
	private String wpoldir = "";
	private String i1 = "";
	private String winddir = "";
	// ';'
	private String i2 = "";
	private String wmeddir = "";
	// ';'
	private String i3 = "";
	private String wanudir = "";
	// ';'
	private String i4 = "";
	private String wmindir = "";
	// ';'
	private String i5 = "";
	private String wpolesq = "";
	// ';'
	private String i6 = "";
	private String windesq = "";
	// ';'
	private String i7 = "";
	private String wmedesq = "";
	// ';'
	private String i8 = "";
	private String wanuesq = "";
	// ';'
	private String i9 = "";
	private String wminesq = "";
	// ';'
	private String i10 = "";
	private String wapelidoAlcunhasIa1 = "";
	// ';'
	private String ia1 = "";
	private String wapelidoAlcunhasIa2 = "";
	// ';'
	private String ia2 = "";
	private String wapelidoAlcunhasIa3 = "";
	// ';'
	private String ia3 = "";
	private String wapelidoAlcunhasIa4 = "";
	// ';'
	private String i11 = "";
	private String waltura = "";
	// ';'
	private String i12 = "";
	private int wanoAutos = 0;
	// ';'
	private String i13 = "";
	private String wavRua = "";
	// ';'
	private String i14 = "";
	private String wbairro = "";
	// ';'
	private String i15 = "";
	private int wbarba = 0;
	// ';'
	private String i16 = "";
	private int wbigode = 0;
	// ';'
	private String i17 = "";
	private int wcep = 0;
	// ';'
	private String i18 = "";
	private int wcodMunicRegGeral = 0;
	// ';'
	private String i19 = "";
	private int wcodMunicipioNascimento = 0;
	// ';'
	private String i20 = "";
	private int wcompleicao = 0;
	// ';'
	private String i21 = "";
	private String wcomplemento = "";
	// ';'
	private String i22 = "";
	private int wcorOlhos = 0;
	// ';'
	private String i23 = "";
	private int wcutis = 0;
	// ';'
	private String i24 = "";
	private int wdataAtuacao = 0;
	// ';'
	private String i25 = "";
	private int wdatdocAtu = 0;
	// ';'
	private String i26 = "";
	private int wdataNasc = 0;
	// ';'
	private String i27 = "";
	private int wdataReg = 0;
	// ';'
	private String i28 = "";
	private String wdataUltimaMovimentUf = "";
	// ';'
	private String i29 = "";
	private long wnumeDocumApresent = 0;
	// ';'
	private String i30 = "";
	private int westatoCivil = 0;
	// ';'
	private String i31 = "";
	private String westado = "";
	// ';'
	private String i32 = "";
	private String wfalecido = "";
	// ';'
	private String i33 = "";
	private int wgrauInstrucao = 0;
	// ';'
	private String i34 = "";
	private String wpossuiInquerito = "";
	// ';'
	private String i35 = "";
	private int whoraAtu = 0;
	// ';'
	private String i36 = "";
	private String whoraPrisao = "";
	// ';'
	private String i37 = "";
	private String wigUf = "";
	// ';'
	private String i38 = "";
	private String wlocal = "";
	// ';'
	private String i39 = "";
	private String wnomeMae = "";
	// ';'
	private String i40 = "";
	private String wmarcaPartCicatTatuag = "";
	// ';'
	private String i41 = "";
	private int wmatfuncAtu = 0;
	// ';'
	private String i42 = "";
	private String wmunicipioRegGeral = "";
	// ';'
	private String i43 = "";
	private String wmotivoPrisaoLei = "";
	// ';'
	private String i44 = "";
	private int wmunicipio = 0;
	// ';'
	private String i45 = "";
	private int wnacionalidadeEstrangeiro = 0;
	// ';'
	private String i46 = "";
	private int wnacionalidade = 0;
	// ';'
	private String i47 = "";
	private String wnaturalidade = "";
	// ';'
	private String i48 = "";
	private String wnomeCompleto = "";
	// ';'
	private String i49 = "";
	private String wnomeAnterior = "";
	// ';'
	private String i50 = "";
	private String wnomeDelegacia = "";
	// ';'
	private String i51 = "";
	private String wnomeVitima = "";
	// ';'
	private String i52 = "";
	private long wnumeroAutos = 0;
	// ';'
	private String i53 = "";
	private int wnumpos = 0;
	// ';'
	private String i54 = "";
	private long wnupro = 0;
	// ';'
	private String i55 = "";
	private String worgaoExpUf = "";
	// ';'
	private String i56 = "";
	private String worgaoExp = "";
	// ';'
	private String i57 = "";
	private String wnomePai = "";
	// ';'
	private String i58 = "";
	private String wpossuiArma = "";
	// ';'
	private String i59 = "";
	private String whaInqueritoPolic = "";
	// ';'
	private String i60 = "";
	private String wpossuiMandatoPAberto = "";
	// ';'
	private String i61 = "";
	private String wpossuiProcesso = "";
	// ';'
	private String i62 = "";
	private String wprofissao = "";
	// ';'
	private String i63 = "";
	private String wquerFolhaAnteced = "";
	// ';'
	private String i64 = "";
	private long wregistroEstadualGeral = 0;
	// ';'
	private String i65 = "";
	private long wregistroFederalCi = 0;
	// ';'
	private String i66 = "";
	private int wsexo = 0;
	// ';'
	private String i67 = "";
	private int wsobrancelhas = 0;
	// ';'
	private String i68 = "";
	private int wstatusReg = 0;
	// ';'
	private String i69 = "";
	private int wtipoProprietarioArma = 0;
	// ';'
	private String i70 = "";
	private String wtipoReg = "";
	// ';'
	private String i71 = "";
	private String wufExp = "";
	// ';'
	private String i72 = "";
	private String wufNaturalidade = "";
	// ';'
	private String i73 = "";
	private String wufRegEstadualGeral = "";
	// ';'
	private String i74 = "";
	private String wdocumApresentado = "";
	// ';'
	private String i75 = "";
	private int wcorCabelos = 0;
	// ';'
	private String i76 = "";
	private int wtipoCabelos = 0;
	// ';'
	private String i77 = "";
	private int wnumero = 0;
	// ';'
	private String i78 = "";
	private String wregistroOutrosEstados = "";
	// ';'
	private int c = 0;
	private String wregCrim; // REGISTROS GRAVADOS ATE 17/06/2008 AS 14:00 NO
								// SIC-CADASTRO

	public Idcpbabn(Result result, Sessao sessao) {
		this.result = result;
		this.sessao = sessao;
	}

	@Post
	public void executar() {
		try {
			main();
		} catch (Exception e) {
			ExceptionProgram excp = new ExceptionProgram();
			excp.trataErro(e, sessao, this.getClass().getSimpleName());
		}
	}

	private void main() throws IOException {
		arquivo1 = new FileWriter("arquivo1");

		while (sicCadastroView.leitura()) {
			// READADA
			wregCrim = "";
			ia3 = ";";
			ia2 = ";";
			ia1 = ";";
			i78 = ";";
			i77 = ";";
			i76 = ";";
			i75 = ";";
			i74 = ";";
			i73 = ";";
			i72 = ";";
			i71 = ";";
			i70 = ";";
			i69 = ";";
			i68 = ";";
			i67 = ";";
			i66 = ";";
			i65 = ";";
			i64 = ";";
			i63 = ";";
			i62 = ";";
			i61 = ";";
			i60 = ";";
			i59 = ";";
			i58 = ";";
			i57 = ";";
			i56 = ";";
			i55 = ";";
			i54 = ";";
			i53 = ";";
			i52 = ";";
			i51 = ";";
			i50 = ";";
			i49 = ";";
			i48 = ";";
			i47 = ";";
			i46 = ";";
			i45 = ";";
			i44 = ";";
			i43 = ";";
			i42 = ";";
			i41 = ";";
			i40 = ";";
			i39 = ";";
			i38 = ";";
			i37 = ";";
			i36 = ";";
			i35 = ";";
			i34 = ";";
			i33 = ";";
			i32 = ";";
			i31 = ";";
			i30 = ";";
			i29 = ";";
			i28 = ";";
			i27 = ";";
			i26 = ";";
			i25 = ";";
			i24 = ";";
			i23 = ";";
			i22 = ";";
			i21 = ";";
			i20 = ";";
			i19 = ";";
			i18 = ";";
			i17 = ";";
			i16 = ";";
			i15 = ";";
			i14 = ";";
			i13 = ";";
			i12 = ";";
			i11 = ";";
			i10 = ";";
			i9 = ";";
			i8 = ";";
			i7 = ";";
			i6 = ";";
			i5 = ";";
			i4 = ";";
			i3 = ";";
			i2 = ";";
			i1 = ";";
			;
			wapelidoAlcunhasIa1 = sicCadastroView.getApelidoAlcunhas(1);
			wapelidoAlcunhasIa2 = sicCadastroView.getApelidoAlcunhas(2);
			wapelidoAlcunhasIa3 = sicCadastroView.getApelidoAlcunhas(3);
			wapelidoAlcunhasIa4 = sicCadastroView.getApelidoAlcunhas(4);
			wpoldir = sicCadastroView.getPolegarDireito();
			winddir = sicCadastroView.getIndicadorDireito();
			wmeddir = sicCadastroView.getMedioDireito();
			wanudir = sicCadastroView.getAnularDireito();
			wmindir = sicCadastroView.getMinimoDireito();
			wpolesq = sicCadastroView.getPolegarEsquerdo();
			windesq = sicCadastroView.getIndicadorEsquerdo();
			wmedesq = sicCadastroView.getMedioEsquerdo();
			wanuesq = sicCadastroView.getAnularEsquerdo();
			wminesq = sicCadastroView.getMinimoEsquerdo();
			wstatusReg = sicCadastroView.getStatusReg();
			wtipoReg = sicCadastroView.getTipoReg();
			wnumpos = sicCadastroView.getNumPos();
			wnupro = sicCadastroView.getNupro();
			wregistroEstadualGeral = sicCadastroView.getRegEstadualGeral();
			wregistroFederalCi = sicCadastroView.getRegFederalCi();
			wigUf = sicCadastroView.getIgUf();
			wnomeCompleto = sicCadastroView.getNomeCompleto();
			wnomePai = sicCadastroView.getNomePai();
			wnomeMae = sicCadastroView.getNomeMae();
			wnomeAnterior = sicCadastroView.getNomeAnterior();
			wdataReg = sicCadastroView.getDataReg();
			wdataNasc = sicCadastroView.getDataNasc();
			wcompleicao = sicCadastroView.getCompleicao();
			wufRegEstadualGeral = sicCadastroView.getUfRegEstadualGeral();
			wmunicipioRegGeral = sicCadastroView.getMunicipioRegGeral();
			wcodMunicRegGeral = sicCadastroView.getCodigoMunicipioRegGeral();
			wdocumApresentado = sicCadastroView.getDocumentoApresent();
			worgaoExpUf = sicCadastroView.getOrgaoExpUfUfUf();
			wnacionalidadeEstrangeiro = sicCadastroView.getNacionEstrangeiro();
			wtipoProprietarioArma = sicCadastroView.getTipoProprietarioArma();
			wdataUltimaMovimentUf = sicCadastroView.getDataUltimaMovimentUf();
			wpossuiInquerito = sicCadastroView.getPossuiInquerito();
			wpossuiArma = sicCadastroView.getPossuiArma();
			wpossuiProcesso = sicCadastroView.getPossuiProcesso();
			wfalecido = sicCadastroView.getFalecido();
			wpossuiMandatoPAberto = sicCadastroView.getPossuiMandatoAberto();
			worgaoExp = sicCadastroView.getOrgaoExp();
			wufExp = sicCadastroView.getUfExp();
			wnomeDelegacia = sicCadastroView.getNomeDelegacia();
			wsexo = sicCadastroView.getSexo();
			wcutis = sicCadastroView.getCodigoCutis();
			wcorCabelos = sicCadastroView.getCodigoCorCabelo();
			wtipoCabelos = sicCadastroView.getCodigoTipoCabelo();
			wcorOlhos = sicCadastroView.getCodigoCorOlhos();
			wsobrancelhas = sicCadastroView.getCodigoSobrancelhas();
			wbarba = sicCadastroView.getCodigoBarba();
			wbigode = sicCadastroView.getCodigoBigode();
			waltura = String.valueOf(sicCadastroView.getAltura());
			wmarcaPartCicatTatuag = sicCadastroView.getMarcaPartCicatTatuag();
			wprofissao = sicCadastroView.getProfissao();
			westatoCivil = sicCadastroView.getEstadoCivil();
			wnacionalidade = sicCadastroView.getNacionalidade();
			wnaturalidade = sicCadastroView.getNaturalidade();
			wcodMunicipioNascimento = sicCadastroView.getCodigoMunicipioNasc();
			wufNaturalidade = sicCadastroView.getUfNaturalidade();
			wgrauInstrucao = sicCadastroView.getGrauInstrucao();
			wavRua = sicCadastroView.getAvRua();
			wnumero = sicCadastroView.getNumero();
			wbairro = sicCadastroView.getBairro();
			wmunicipio = sicCadastroView.getMunicipio();
			westado = sicCadastroView.getEstado();
			wcep = sicCadastroView.getCep();
			wcomplemento = sicCadastroView.getComplemento();
			wmotivoPrisaoLei = sicCadastroView.getMotivoPrisaoLei();
			wdataAtuacao = sicCadastroView.getDataAtuacao();
			whoraPrisao = sicCadastroView.getHoraPrisao();
			wnomeVitima = sicCadastroView.getNomeVitima();
			wlocal = sicCadastroView.getLocal();
			whaInqueritoPolic = sicCadastroView.getInqueritoPolicial();
			wquerFolhaAnteced = sicCadastroView.getQuerFolhaAnteced();
			wmatfuncAtu = sicCadastroView.getMatriculaFuncAtu();
			wdatdocAtu = sicCadastroView.getDataDocAtu();
			whoraAtu = sicCadastroView.getHoraAtu();
			wregistroOutrosEstados = sicCadastroView.getRegOutrosEstados();
			wregCrim = UtilBean.moveSubstring(wregCrim, 0, 7, "A", wpoldir);
			wregCrim = UtilBean.moveSubstring(wregCrim, 7, 1, "A", i1);
			wregCrim = UtilBean.moveSubstring(wregCrim, 8, 7, "A", winddir);
			wregCrim = UtilBean.moveSubstring(wregCrim, 15, 1, "A", i2);
			wregCrim = UtilBean.moveSubstring(wregCrim, 16, 7, "A", wmeddir);
			wregCrim = UtilBean.moveSubstring(wregCrim, 23, 1, "A", i3);
			wregCrim = UtilBean.moveSubstring(wregCrim, 24, 7, "A", wanudir);
			wregCrim = UtilBean.moveSubstring(wregCrim, 31, 1, "A", i4);
			wregCrim = UtilBean.moveSubstring(wregCrim, 32, 7, "A", wmindir);
			wregCrim = UtilBean.moveSubstring(wregCrim, 39, 1, "A", i5);
			wregCrim = UtilBean.moveSubstring(wregCrim, 40, 7, "A", wpolesq);
			wregCrim = UtilBean.moveSubstring(wregCrim, 47, 1, "A", i6);
			wregCrim = UtilBean.moveSubstring(wregCrim, 48, 7, "A", windesq);
			wregCrim = UtilBean.moveSubstring(wregCrim, 55, 1, "A", i7);
			wregCrim = UtilBean.moveSubstring(wregCrim, 56, 7, "A", wmedesq);
			wregCrim = UtilBean.moveSubstring(wregCrim, 63, 1, "A", i8);
			wregCrim = UtilBean.moveSubstring(wregCrim, 64, 7, "A", wanuesq);
			wregCrim = UtilBean.moveSubstring(wregCrim, 71, 1, "A", i9);
			wregCrim = UtilBean.moveSubstring(wregCrim, 72, 7, "A", wminesq);
			wregCrim = UtilBean.moveSubstring(wregCrim, 79, 1, "A", i10);
			wregCrim = UtilBean.moveSubstring(wregCrim, 80, 30, "A", wapelidoAlcunhasIa1);
			wregCrim = UtilBean.moveSubstring(wregCrim, 110, 1, "A", ia1);
			wregCrim = UtilBean.moveSubstring(wregCrim, 111, 30, "A", wapelidoAlcunhasIa2);
			wregCrim = UtilBean.moveSubstring(wregCrim, 141, 1, "A", ia2);
			wregCrim = UtilBean.moveSubstring(wregCrim, 142, 30, "A", wapelidoAlcunhasIa3);
			wregCrim = UtilBean.moveSubstring(wregCrim, 172, 1, "A", ia3);
			wregCrim = UtilBean.moveSubstring(wregCrim, 173, 30, "A", wapelidoAlcunhasIa4);
			wregCrim = UtilBean.moveSubstring(wregCrim, 203, 1, "A", i11);
			wregCrim = UtilBean.moveSubstring(wregCrim, 204, 1, "A", waltura);
			wregCrim = UtilBean.moveSubstring(wregCrim, 205, 1, "A", i12);
			wregCrim = UtilBean.moveSubstring(wregCrim, 206, 4, "N", wanoAutos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 210, 1, "A", i13);
			wregCrim = UtilBean.moveSubstring(wregCrim, 211, 30, "A", wavRua);
			wregCrim = UtilBean.moveSubstring(wregCrim, 241, 1, "A", i14);
			wregCrim = UtilBean.moveSubstring(wregCrim, 242, 20, "A", wbairro);
			wregCrim = UtilBean.moveSubstring(wregCrim, 262, 1, "A", i15);
			wregCrim = UtilBean.moveSubstring(wregCrim, 263, 1, "N", wbarba);
			wregCrim = UtilBean.moveSubstring(wregCrim, 264, 1, "A", i16);
			wregCrim = UtilBean.moveSubstring(wregCrim, 265, 1, "N", wbigode);
			wregCrim = UtilBean.moveSubstring(wregCrim, 266, 1, "A", i17);
			wregCrim = UtilBean.moveSubstring(wregCrim, 267, 8, "N", wcep);
			wregCrim = UtilBean.moveSubstring(wregCrim, 275, 1, "A", i18);
			wregCrim = UtilBean.moveSubstring(wregCrim, 276, 4, "N", wcodMunicRegGeral);
			wregCrim = UtilBean.moveSubstring(wregCrim, 280, 1, "A", i19);
			wregCrim = UtilBean.moveSubstring(wregCrim, 281, 4, "N", wcodMunicipioNascimento);
			wregCrim = UtilBean.moveSubstring(wregCrim, 285, 1, "A", i20);
			wregCrim = UtilBean.moveSubstring(wregCrim, 286, 2, "N", wcompleicao);
			wregCrim = UtilBean.moveSubstring(wregCrim, 288, 1, "A", i21);
			wregCrim = UtilBean.moveSubstring(wregCrim, 289, 20, "A", wcomplemento);
			wregCrim = UtilBean.moveSubstring(wregCrim, 309, 1, "A", i22);
			wregCrim = UtilBean.moveSubstring(wregCrim, 310, 1, "N", wcorOlhos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 311, 1, "A", i23);
			wregCrim = UtilBean.moveSubstring(wregCrim, 312, 1, "N", wcutis);
			wregCrim = UtilBean.moveSubstring(wregCrim, 313, 1, "A", i24);
			wregCrim = UtilBean.moveSubstring(wregCrim, 314, 8, "N", wdataAtuacao);
			wregCrim = UtilBean.moveSubstring(wregCrim, 322, 1, "A", i25);
			wregCrim = UtilBean.moveSubstring(wregCrim, 323, 8, "N", wdatdocAtu);
			wregCrim = UtilBean.moveSubstring(wregCrim, 331, 1, "A", i26);
			wregCrim = UtilBean.moveSubstring(wregCrim, 332, 8, "N", wdataNasc);
			wregCrim = UtilBean.moveSubstring(wregCrim, 340, 1, "A", i27);
			wregCrim = UtilBean.moveSubstring(wregCrim, 341, 8, "N", wdataReg);
			wregCrim = UtilBean.moveSubstring(wregCrim, 349, 1, "A", i28);
			wregCrim = UtilBean.moveSubstring(wregCrim, 350, 8, "A", wdataUltimaMovimentUf);
			wregCrim = UtilBean.moveSubstring(wregCrim, 358, 1, "A", i29);
			wregCrim = UtilBean.moveSubstring(wregCrim, 359, 11, "N", wnumeDocumApresent);
			wregCrim = UtilBean.moveSubstring(wregCrim, 370, 1, "A", i30);
			wregCrim = UtilBean.moveSubstring(wregCrim, 371, 1, "N", westatoCivil);
			wregCrim = UtilBean.moveSubstring(wregCrim, 372, 1, "A", i31);
			wregCrim = UtilBean.moveSubstring(wregCrim, 373, 2, "A", westado);
			wregCrim = UtilBean.moveSubstring(wregCrim, 375, 1, "A", i32);
			wregCrim = UtilBean.moveSubstring(wregCrim, 376, 1, "A", wfalecido);
			wregCrim = UtilBean.moveSubstring(wregCrim, 377, 1, "A", i33);
			wregCrim = UtilBean.moveSubstring(wregCrim, 378, 1, "N", wgrauInstrucao);
			wregCrim = UtilBean.moveSubstring(wregCrim, 379, 1, "A", i34);
			wregCrim = UtilBean.moveSubstring(wregCrim, 380, 1, "A", wpossuiInquerito);
			wregCrim = UtilBean.moveSubstring(wregCrim, 381, 1, "A", i35);
			wregCrim = UtilBean.moveSubstring(wregCrim, 382, 8, "N", whoraAtu);
			wregCrim = UtilBean.moveSubstring(wregCrim, 390, 1, "A", i36);
			wregCrim = UtilBean.moveSubstring(wregCrim, 391, 8, "A", whoraPrisao);
			wregCrim = UtilBean.moveSubstring(wregCrim, 399, 1, "A", i37);
			wregCrim = UtilBean.moveSubstring(wregCrim, 400, 20, "A", wigUf);
			wregCrim = UtilBean.moveSubstring(wregCrim, 420, 1, "A", i38);
			wregCrim = UtilBean.moveSubstring(wregCrim, 421, 30, "A", wlocal);
			wregCrim = UtilBean.moveSubstring(wregCrim, 451, 1, "A", i39);
			wregCrim = UtilBean.moveSubstring(wregCrim, 452, 60, "A", wnomeMae);
			wregCrim = UtilBean.moveSubstring(wregCrim, 512, 1, "A", i40);
			wregCrim = UtilBean.moveSubstring(wregCrim, 513, 60, "A", wmarcaPartCicatTatuag);
			wregCrim = UtilBean.moveSubstring(wregCrim, 573, 1, "A", i41);
			wregCrim = UtilBean.moveSubstring(wregCrim, 574, 7, "N", wmatfuncAtu);
			wregCrim = UtilBean.moveSubstring(wregCrim, 581, 1, "A", i42);
			wregCrim = UtilBean.moveSubstring(wregCrim, 582, 30, "A", wmunicipioRegGeral);
			wregCrim = UtilBean.moveSubstring(wregCrim, 612, 1, "A", i43);
			wregCrim = UtilBean.moveSubstring(wregCrim, 613, 60, "A", wmotivoPrisaoLei);
			wregCrim = UtilBean.moveSubstring(wregCrim, 673, 1, "A", i44);
			wregCrim = UtilBean.moveSubstring(wregCrim, 674, 4, "N", wmunicipio);
			wregCrim = UtilBean.moveSubstring(wregCrim, 678, 1, "A", i45);
			wregCrim = UtilBean.moveSubstring(wregCrim, 679, 4, "N", wnacionalidadeEstrangeiro);
			wregCrim = UtilBean.moveSubstring(wregCrim, 683, 1, "A", i46);
			wregCrim = UtilBean.moveSubstring(wregCrim, 684, 2, "N", wnacionalidade);
			wregCrim = UtilBean.moveSubstring(wregCrim, 686, 1, "A", i47);
			wregCrim = UtilBean.moveSubstring(wregCrim, 687, 35, "A", wnaturalidade);
			wregCrim = UtilBean.moveSubstring(wregCrim, 722, 1, "A", i48);
			wregCrim = UtilBean.moveSubstring(wregCrim, 723, 60, "A", wnomeCompleto);
			wregCrim = UtilBean.moveSubstring(wregCrim, 783, 1, "A", i49);
			wregCrim = UtilBean.moveSubstring(wregCrim, 784, 60, "A", wnomeAnterior);
			wregCrim = UtilBean.moveSubstring(wregCrim, 844, 1, "A", i50);
			wregCrim = UtilBean.moveSubstring(wregCrim, 845, 30, "A", wnomeDelegacia);
			wregCrim = UtilBean.moveSubstring(wregCrim, 875, 1, "A", i51);
			wregCrim = UtilBean.moveSubstring(wregCrim, 876, 60, "A", wnomeVitima);
			wregCrim = UtilBean.moveSubstring(wregCrim, 936, 1, "A", i52);
			wregCrim = UtilBean.moveSubstring(wregCrim, 937, 11, "N", wnumeroAutos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 948, 1, "A", i53);
			wregCrim = UtilBean.moveSubstring(wregCrim, 949, 3, "N", wnumpos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 952, 1, "A", i54);
			wregCrim = UtilBean.moveSubstring(wregCrim, 953, 9, "N", wnupro);
			wregCrim = UtilBean.moveSubstring(wregCrim, 962, 1, "A", i55);
			wregCrim = UtilBean.moveSubstring(wregCrim, 963, 15, "A", worgaoExpUf);
			wregCrim = UtilBean.moveSubstring(wregCrim, 978, 1, "A", i56);
			wregCrim = UtilBean.moveSubstring(wregCrim, 979, 15, "A", worgaoExp);
			wregCrim = UtilBean.moveSubstring(wregCrim, 994, 1, "A", i57);
			wregCrim = UtilBean.moveSubstring(wregCrim, 995, 60, "A", wnomePai);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1055, 1, "A", i58);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1056, 1, "A", wpossuiArma);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1057, 1, "A", i59);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1058, 1, "A", whaInqueritoPolic);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1059, 1, "A", i60);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1060, 1, "A", wpossuiMandatoPAberto);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1061, 1, "A", i61);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1062, 1, "A", wpossuiProcesso);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1063, 1, "A", i62);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1064, 30, "A", wprofissao);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1094, 1, "A", i63);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1095, 1, "A", wquerFolhaAnteced);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1096, 1, "A", i64);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1097, 11, "N", wregistroEstadualGeral);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1108, 1, "A", i65);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1109, 11, "N", wregistroFederalCi);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1120, 1, "A", i66);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1121, 1, "N", wsexo);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1122, 1, "A", i67);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1123, 1, "N", wsobrancelhas);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1124, 1, "A", i68);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1125, 1, "N", wstatusReg);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1126, 1, "A", i69);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1127, 2, "N", wtipoProprietarioArma);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1129, 1, "A", i70);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1130, 2, "A", wtipoReg);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1132, 1, "A", i71);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1133, 2, "A", wufExp);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1135, 1, "A", i72);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1136, 2, "A", wufNaturalidade);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1138, 1, "A", i73);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1139, 2, "A", wufRegEstadualGeral);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1141, 1, "A", i74);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1142, 30, "A", wdocumApresentado);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1172, 1, "A", i75);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1173, 1, "N", wcorCabelos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1174, 1, "A", i76);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1175, 1, "N", wtipoCabelos);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1176, 1, "A", i77);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1177, 8, "N", wnumero);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1185, 1, "A", i78);
			wregCrim = UtilBean.moveSubstring(wregCrim, 1186, 20, "A", wregistroOutrosEstados);
			arquivo1.write(wregCrim);
			c += 1;
		}

		if (sicCadastroView.registrosProcessados() == 0) {
			UtilBean.mensagemTexto("#ERRO LEITURA: REGISTRO NAO ENCONTRADO NO SIC-CADASTRO");
		} else {
			UtilBean.mensagemTexto("*** TOTAL DE REGISTROS GERADOS NO CRIMINAL = " + c);
		}
		arquivo1.close();
	}
}
